import {
  request
} from './request'

const METHOD = {
  POST: 'POST',
  GET: 'GET',
  PUT: 'PUT',
  DELETE: 'DELETE'
}

const BASE_URL = 'https://xxx/'

// 小程序登录
export const login = (data) => {
  return request(METHOD.POST, data, BASE_URL + 'xcx/login')
}

// 用户登录
export const userLogin = (data) => {
  return request(METHOD.POST, data, BASE_URL + 'user/login')
}

// 查询用户信息
export const userDetail = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'user/detail')
}

// 查询指定用户全部信息
export const userDetailAll = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'user/detailAll')
}

// 查询用户列表
export const listUser = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'user/list')
}

// 查询团长收益
export const chiefProfit = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'user/chief/fee')
}

// 修改用户信息
export const updateUserInfo = (data) => {
  return request(METHOD.POST, data, BASE_URL + 'user/update')
}

// 查询活动信息
export const listActivities = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'activity/list')
}

// 获取推广信息
export const getPromotion = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'promotion/get')
}

// 美团优选
export const youxuan = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'promotion/youXuan')
}

// 查询活动订单
export const activityOrders = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'order/list/chief')
}

// 查询我的海报
export const myPoster = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'image/my-poster')
}

// 查询图片
export const getImage = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'image/get')
}

// 申请提现
export const withdrawApply = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'withdraw/apply')
}

// 查询提现记录
export const withdrawList = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'withdraw/list/my')
}

// 获取枚举信息
export const dicEnum = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'dic/get')
}

// 城市商品类目
export const categories = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'meituan/tuandan/categories')
}

// 美团优选商铺信息
export const shops = (data) => {
  return request(METHOD.POST, data, BASE_URL + 'meituan/tuandan/shops')
}

// 美团优选商铺优惠套餐
export const deals = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'meituan/tuandan/deals')
}

// 查询小程序文本
export const text = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'text/list')
}

// 添加用户点击记录
export const cilckRecord = (data) => {
  return request(METHOD.POST, data, BASE_URL + 'click/record/add')
}

// 查询电商平台信息
export const listECPlatform = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'ec/list/platform')
}

// 查询电商商品
export const listGoods = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'ec/list/goods')
}

// 商品转链
export const goodsConvert = (data) => {
  return request(METHOD.GET, data, BASE_URL + 'ec/convert')
}

// 查询推荐商品
export const recommendGoods = (data) =>{
  return request(METHOD.GET,data,BASE_URL+'ec/list/recommend')
}